// 用下划线作为文件名前缀，让go build构建C静态库时忽略这个文件

#include "casdac.h"
#include <stdio.h>
#include <stdlib.h>

// fetchData 获取数据
void fetchData(double buffer[], int samples_per_second) {
    return;
}

int main() {
    initialize();
    int samples_per_100_milliseconds = 1000;
    double *buffer = (double *)malloc(samples_per_100_milliseconds * sizeof(double));
    if (buffer == NULL) {
        puts("failed to allocate space for buffer");
        exit(-1);
    }
    fetchData(buffer, samples_per_100_milliseconds * 10);
    return 0;
}

